function change(event, callback) { //change
	var ks,
		ar = [],
		pe = Object.assign({}, event.currentTarget.dataset, {
			keys: ks = event.detail.value
		}),
		pg = pe.range,
		pv = pg ? (
			(ks instanceof Array ? ks : [ks - 0]).forEach(function(n, i) {
				ar.push(
					pg[i] instanceof Array ? pg[i][n] : pg[n]
				)
			}), ar
		) : ks,
		pm = pe.mode;
	if(pv && pm) {
		this.input(false, {
      [pm]: pv instanceof Array && pv.length ==1  ? pv[0] : pv 
    }, callback);
	} else {
		console.warn('missing necessary parameters');
	}
}

function multiColChange(e) {
	var p = this,
		pd = p.data,
		mk = e.currentTarget.dataset.key,
		mo = pd[mk],
		iter = p.multiColIter(e, mo, p),
		cp = {};
	if(iter[0] < mo.multiDataLayer - 1) {
		p.multiColIter({
			detail: {
				column: iter[0],
				value: iter[1]
			}
		}, mo, p);
	}
	Object.assign(cp[mk] = {}, mo);
	p.setData(cp);
}

function multiColIter(e, mo, p) {
	var ed = e.detail,
		column = ed.column,
		mi = mo.multiIndex,
		cd = column + 1;
	if(column != mo.multiDataLayer - 1) {
		var cr = p.multiArrayColChange(mo, column, ed.value),
			cl = cr.length - 1;
		mo.multiArray[cd] = cr;
		if(mi[cd] > cl) {
			mi[cd] = cl;
		}
	}
	mi[column] = ed.value;
	return [cd, mi[cd]];
}

function multiArrayColChange(mo, column, value) {
	if(column != mo.multiDataLayer - 1) {
		var k = mo.multiArray[column][value],
			d = mo.multiDataArr,
			v = d[column].find(function(n) {
				return n.value == k;
			})[mo.childKey],
			c = [],
			pi = mo.parentKey;
		return d[column + 1].forEach(function(n) {
			n.pi == v && c.push(n.value);
		}), c;
	}
}

function multiArrayColInit(mk, bo) {
	var pd = this.data,
		mul = pd[mk],
		multiDataArr = mul.multiDataArr,
		multiArray = mul.multiArray = [],
		multiDataLayer = mul.multiDataLayer = multiDataArr.length,
		pi = mul.parentKey || 'pi',
		ci = mul.childKey || 'ci',
		k = '',
		cp = {},
		lr = [],
		lk = [];

	multiDataArr.forEach(function(n, i) {
		var c = [];
		multiArray[i] = (
			i ? (
				c = n.filter(function(j) {
					return j.pi == k;
				}), k = c[0].ci, c
			) : k = n[0].ci, n
		).map(function(n) {
			return n.value;
		});
		lk.push(multiArray[i][0]);
		lr.push(0);
	});
	Object.assign(cp[mk] = {}, mul, {
		multiIndex: lr,
		parentKey: pi,
		childKey: ci
	});
	if(bo) {
		this.setData(cp);
	} else {
		return cp;
	}
}